package org.naxx.security.model.request;

import java.util.ArrayList;
import java.util.List;

/**
 * This class is used only to abstract common
 * behavior of Actions, Environments, Resources
 * and Subjects.
 */
abstract class AbstractRequestElement {
	
	protected List<Attribute> attributes;
	
	AbstractRequestElement() {
		this.attributes = new ArrayList<Attribute>();
	}
	
	AbstractRequestElement(List<Attribute> attributes) {
		this.attributes = attributes;
	}
	
	public final List<Attribute> getAttributes() {
		return this.attributes;
	}
	public final void addAttribute(Attribute attribute) {
		this.attributes.add(attribute);
	}
	public final void addAttributes(List<Attribute> attributes) {
		this.attributes.addAll(attributes);
	}
}
